﻿using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProtoBuf;

namespace ZyGames.DZPocker.Model
{
	[Serializable, ProtoContract]
	public class SimpleInsuranceModelPool
	{
		public SimpleInsuranceModelPool()
		{
			this.ListUsr = new List<UserAndOuts>();
			this.Common = new List<int>();
			this.Outs = new List<int>();

			this.BuyOuts = new List<int>();
		}

		[ProtoMember(1)]
		public int TableID { get; set; }

		/// <summary>
		/// 底池编号
		/// </summary>
		[ProtoMember(2)]
		public int NumberID { get; set; }

		/// <summary>
		/// 底池筹码基数
		/// </summary>
		[ProtoMember(3)]
		public int AntNum { get; set; }

		/// <summary>
		/// 赔率 1:odds
		/// </summary>
		[ProtoMember(4)]
		public float Odds { get; set; }

		/// <summary>
		/// 所有玩家手牌
		/// </summary>
		[ProtoMember(5)]
		public List<UserAndOuts> ListUsr { get; set; }

		/// <summary>
		/// 桌子上的公共牌
		/// </summary>
		[ProtoMember(6)]
		public List<int> Common { get; set; }

		/// <summary>
		/// outs牌
		/// </summary>
		[ProtoMember(7)]
		public List<int> Outs { get; set; }

		/// <summary>
		/// 可购买的最大筹码（底池-当前购买的记录）
		/// </summary>
		[ProtoMember(8)]
		public int MaxCanBuyChip { get; set; }

		/// <summary>
		/// 是否可以触发保险(存在唯一一个最大值)
		/// </summary>
		[ProtoMember(9)]
		public bool IsCanShowInsurance { get; set; }

		/// <summary>
		/// 是否是主池
		/// </summary>
		[ProtoMember(10)]
		public bool IsMainPool { get; set; }

		/// <summary>
		/// 最大的牌的玩家ID(这个玩家购买保险)
		/// </summary>
		[ProtoMember(11)]
		public int MaxUserId { get; set; }

		/// <summary>
		/// 人均下注基数
		/// </summary>
		[ProtoMember(12)]
		public int PerBetNum { get; set; }

		/// <summary>
		/// 最大牌的玩家位置
		/// </summary>
		[ProtoMember(13)]
		public int MaxCardsPosId { get; set; }


		//*******************************************实际购买的保险相关信息*****************************************//
		/// <summary>
		/// 玩家是否购买了保险
		/// </summary>
		[ProtoMember(14)]
		public bool IsBuyInsurance { get; set; }


		[ProtoMember(15)]
		/// <summary>
		/// 玩家购买的保险金额( 这个* 赔率就是赔付金额)
		/// </summary>
		public int ActualBuyNum { get; set; }

		/// <summary>
		/// 玩家购买的Outs
		/// </summary>
		[ProtoMember(16)]
		public List<int> BuyOuts { get; set; }

		/// <summary>
		/// 实际的赔率
		/// </summary>
		[ProtoMember(17)]
		public float ActualOdds { get; set; }

		/// <summary>
		/// 当前回合保险应该赔付的金额  ActualBuyNum * ActualOdds   这个要记录到TableData的保险盈亏记录里面
		/// </summary>
		[ProtoMember(18)]
		public int CurrentRoundCompensate { get; set; }

		/// <summary>
		/// 当前回合玩家是否操作过了保险(如果时间到还没有操作完成的 自动当做弃权 自动赋予操作过)
		/// </summary>
		[ProtoMember(19)]
		public bool CurrentRoundIsOperated { get; set; }


		public void Clear()
		{
			this.ListUsr.Clear();
			this.Common.Clear();
			this.Outs.Clear();
			this.BuyOuts.Clear();
		}
	}
}
